package project.parser.ast.exps.op.unary;

import project.parser.ast.exps.Exp;

import static project.parser.tokenizer.TokenType.CLOSED_PAR;
import static project.parser.tokenizer.TokenType.OPEN_PAR;

public abstract class UnaryOp implements Exp {
	protected final Exp exp;

	public UnaryOp(Exp exp) {
		this.exp = exp;
	}

	abstract protected String opToString();

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder().append(OPEN_PAR)
				.append(opToString()).append(exp).append(CLOSED_PAR);
		return sb.toString();
	}
}
